package javase.module2.task05;

public class Direction {
    private final String desc;

    // 2.声明本类类型的引用指向本类类型的对象
    public static final Direction UP = new Direction("向上");
    public static final Direction DOWN = new Direction("向下");
    public static final Direction LEFT = new Direction("向左");
    public static final Direction RIGHT = new Direction("向右");

    // 1.私有化构造方法
    private Direction(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }
}
